package com.zhisheng.users.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * (Users)表实体类
 *
 * @author 全哥
 * @since 2025-02-22 10:31:03
 */
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
public class Users extends Model<Users> {

    public static void main(String[] args) {
        System.out.println(JSONObject.toJSONString(new Users(5, "zs", "123", 0)));
    }

    @TableId
    private Integer id;

    private String username;

    private String password;

    @TableLogic
    private Integer isDel;


    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    public Serializable pkVal() {
        return this.id;
    }
}

